import request from "@/utils/request";

export const  getAllGroup = (params,data) => {
    return request({
        url: "/group/getAllGroup",
        method: "POST",
        params:params,
        data:data,
    });
};
export const getGroupOfOneTask = (params) => {
    return request({
        url: "/group/getGroupOfOneTask",
        method: "GET",
        params:params,
    });
};

export const getNotGroupOfOneTask = (params) => {
    return request({
        url: "/group/getNotGroupOfOneTask",
        method: "GET",
        params:params,
    });
};
/**
 * 搜索工作组
 *
 * @returns
 */
// export const getAllGroup = (data) => {
//     return request({
//         url: "/group/getAllGroup",
//         method: "POST",
//         data
//     });
// };

/**
 * 往工作组中添加员工
 *
 * @returns
 */
export const addEmployeeToGroup = (params) => {
    return request({
        url: "/group/addEmployeeToGroup",
        method: "POST",
        params: params,
    });
};

/**
 * 添加工作组
 *
 * @returns
 */
export const addGroup = (data) => {
    return request({
        url: "/group/addGroup",
        method: "POST",
        data,
    });
};

/**
 * 查询所有可用员工
 *
 * @returns
 */
export const findEmployee = () => {
    return request({
        url: "/group/findEmployee",
        method: "GET",
    });
};

/**
 * 往工作组中添加员工
 *
 * @returns
 */
export const findEmployeeByGroupId = (group_id) => {
    return request({
        url: "/group/findEmployeeByGroupId",
        method: "GET",
        params: group_id,
    });
};

/**
 * 删除工作组
 *
 * @returns
 */
export const deleteGroup = (group_id_list) => {
    return request({
        url: "/group/deleteGroup",
        method: "GET",
        params: group_id_list,
    });
};

/**
 * 查询自己的所有工作组
 *
 * @returns
 */
export const findGroupByUserId = () => {
    return request({
        url: "/group/findGroupByUserId",
        method: "GET",
    });
};